<template>
<div class='user-create'>
    <el-page-header @back="goBack" content="新增用户">
</el-page-header>   <el-divider><i class="el-icon-mobile-phone"></i></el-divider>
<el-form label-width="50px" size="small">
    <el-form-item label="实名">
<el-input v-model="form.realname" placeholder="请输入内容"></el-input>
    </el-form-item>
    <el-form-item label="性别">
<el-input v-model="form.gender" placeholder="请输入内容"></el-input>
    </el-form-item>
    <el-form-item label="地址">
         <el-input placeholder="请输入地址" v-model="form.address">
    <template slot="prepend">Http://</template>
  </el-input>
    </el-form-item>
        <el-form-item label="介绍">
        <el-input type="textarea" :rows="4" v-model="form.introduce" placeholder="请输入内容"> </el-input>
    </el-form-item>
    <el-form-item style="text-align:right">
        <el-button type="primary" icon="el-icon-edit" @click="submitHandler">提交<i class="el-icon-upload el-icon--right"></i></el-button>
    </el-form-item>
</el-form>
</div>
</template>

<script>
import { post } from '@/utils/request';
export default{
data() {
return{
    form:{}
}
},
 created() {
    console.log(this.$router);
        this.form=this.$route.query;
  },
methods:{
     submitHandler(){
    let url='http://39.106.31.187:8888/baseUser/saveOrUpdate'
    post(url,this.form).then(Resp =>{
      this.$message({type:"success",message:Resp.message})  
      this.goBack();
    })
    },
       goBack(){
     this.$router.back();    
    }
}
}
</script>
<style scoped>

</style>

